#ifndef _QUEUESTACK_H
#define _QUEUESTACK_H
#include<iostream>

class ListNode 
{
public: 
	ListNode(int data_)
	{
	data = data_;
	next = NULL;
	before=NULL;
	}
	ListNode(int x1,int y1)
	{
		next = NULL;
		x=x1;
		y=y1;
		data=5;			//������Ϊ��������ʱ�ж����Ƿ�Ϊ��ջ 
		before=NULL;
	}
	ListNode* next;
	ListNode* before;
	int data,x,y;
};




class Queue
{
protected: 
	ListNode* head; // ͷָ��
	ListNode* tail; // βָ��  
	int Size; // �ӳ� 
public:
	Queue() 
	{
		head = NULL;	
		tail = NULL; 
		Size = 0;
	}
	~Queue();
	int Qsize()  { return Size;} //���ص�ǰ�ӳ�
	void push(int data) ;//��Ӳ��� 
	int pop();// ���Ӳ���,���س��ӵ��� 
};
class Stack
{
protected:
	ListNode* head;
	int Size;
public:
    Stack() {head=NULL;Size=0;}
    ~Stack();
	int Ssize() { return Size;} //���ص�ǰջ��
    void push(int a);//��ջ���� 
    int pop();// ��ջ���������س�ջ���� 
	};

#endif // !_QUEUESTACK_H